<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.15.9/theme-chalk/index.css">

    <style>
        .el-header, .el-footer {
            background-color: #B3C0D1;
            color: #333;
            text-align: center;
            line-height: 60px;
        }
        .el-main {
            background-color: #E9EEF3;
            color: #333;
            text-align: center;
            line-height: 30px;
        }
    </style>
</head>
<body>

<div id="app">

    <el-header style="background-color: #0095d7;text-align: center">
        <h1 style="color: white;font-size: 22px">
            疫情工作管理页面
        </h1>
    </el-header>

    <el-container>
        <el-header>发布疫情动态</el-header>
        <el-main>


            <el-input placeholder="请输入文章类别" v-model="dynamic.type" class="input-with-select"></el-input>
            <el-input placeholder="请输入文章标题" v-model="dynamic.title" class="input-with-select"></el-input>
            <el-input placeholder="发布者" v-model="dynamic.poster" class="input-with-select"></el-input>
            <el-input
                    type="textarea"
                    autosize
                    placeholder="请输入正文"
                    v-model="dynamic.content"
            >
            </el-input>
            <input type="button" value="发布文章" @click="post()">

        </el-main>
    </el-container>

</div>

</body>

<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>

<!-- import Vue before Element -->
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<!-- import JavaScript -->
<script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
<script>
    let v = new Vue({
        el: '#app',
        data: function() {

            return {


                select: '',
                dynamic:{
                    type:"",title:"",content:"",poster:"",postDate:new Date()                }


            }



        },
        methods: {
            post(){
                axios.post("/evil/dynamic/post",v.dynamic).then(function () {
                    location.href="/index.html";
                })
            }


        }

    })
</script>
</html>